package com.lucky.common.mapper;

import com.lucky.common.pojo.po.UserPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<UserPO> {
	
	@Select("SELECT * FROM m_user o WHERE o.user_code=#{userCode}")
	public UserPO getUserByUserCode(@Param("userCode") String userCode);
	
	@Select("select * from m_user u where u.user_code = #{username} and u.password = #{password} ")
	public UserPO getUserByNameAndPwd(@Param("username") String username, @Param("password") String password);

	public List<String> getMobileNum(Map<String, Object> map);

	@Select("select session_id from mcp_spring_session t where t.PRINCIPAL_NAME =#{userCode} ")
	public String getUserSession(String userCode);

	@Select("SELECT * FROM M_USER U WHERE U.ORG_ID = #{orgId}")
	public List<UserPO> getUserByOrgId(@Param("orgId") Long orgId);
}